<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2022/12/21
 * Time: 17:33
 */

namespace App\Observers;


use App\Models\Seller as SellerModel;
use App\Models\VisitHistoryModel;

class SellerObserver
{
    public function creating(SellerModel $model)
    {

    }

    public function updating(SellerModel $model)
    {

    }

    public function created(SellerModel $model)
    {
        VisitHistoryModel::create([
                'seller_id' => $model->id,
                'current_date' => date('Y-m-d'),
                'user_id' => $model->user_id,
                'today_visit' => 0,
                'order_visit' => 0,
                'refresh_visit' => 0,
                'total_visit' => 0,
        ]);
    }

    public function updated(SellerModel $model)
    {

    }

    public function saving(SellerModel $model)
    {


    }

    public function saved(SellerModel $model)
    {

    }
}